package com.xian.ucenter.controller.admin;

import com.xian.ucenter.commons.Result;
import com.xian.ucenter.entities.vo.UserLogin;
import com.xian.ucenter.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@CrossOrigin
@RestController
@RequestMapping("/ucenter/admin")
public class AdminController {
    @Autowired
    private IndexService indexService;
    @PostMapping("/login")
    public Result login(@RequestBody UserLogin userLogin) {
        return indexService.login(userLogin);
    }
    @GetMapping("/getInfo")
    public Result getInfo(HttpServletRequest request) {
        return indexService.getInfo(request);
    }
    @GetMapping("/logout")
    public Result logout(HttpServletRequest request) {
        return indexService.logout(request);
    }
}
